home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
database
/
tickle15.zip
/
TKL.PPS
< prev
next >
Wrap
Text File
|
1996-08-02
|
41KB
|
1,468 lines
'
' Declare our variables
'
STRING dbfields(49), file_name, pcbtext_number, main_prompt, key
STRING user_input, pcb_user_name, field_name, next_file_entry
STRING hold, hold2, flag_files(24), desc_hold, flag_list, temp
STRING user_input2, stack_var, temp_var, dlpath_lst, first_letter
STRING ndx_file_name, dlpath_lst_entry, file_root, file_ext, bank_path
STRING tkltext, reg_code, user_input3, cname_file, tkl_cfg, passed_name
STRING capture_file, qwk_file, cfg_sl
INT cmd_line_count, filenames_used, next_flag_file, bank_time
INT count, x, i, hold_num, start, end, letter_value
INT alpha, temp_int, index_start, index_end, current_record
INT low_record, high_record, y, cname_size, temptime
STRING last_date ' Last date user used Bank
STRING wd_byte_date ' Last date of bytes w/d
STRING wd_time_date ' Last date of time w/d
STRING max_dl_bytes ' Password file D/L Byte Limit
INTEGER byte_wd ' bytes withdrawn for day
INTEGER max_byte_wd ' Max bytes user can w/d per day (CFG)
INTEGER bank_bytes ' Current Bank Bytes
INTEGER max_bank_bytes ' Maximum bytes to deposit (CFG)
INTEGER size ' Generic INTEGER variable
INTEGER tempbytes ' Generic INTEGER variable
INTEGER time_wd ' time withdrawn for day
INT max_time_wd ' Max time user can w/d per day (CFG)
INT max_bank_time ' Maximum time allowed to deposit (CFG)
LONG file_size, ndx_size, seek_record, value
FLOAT high_num, low_num, rec_num
BOOLEAN menu_displayed, did_list, did_delete, did_reorg
BOOLEAN start_flag, did_flag, did_help, edit_description
BOOLEAN do_menu, file_exists, cfg_file_exist, name_found
BOOLEAN done, registered, use_bank, file_dupe, used_bank
DECLARE PROCEDURE WAIT_FOR_KEY()
*$USEFUNCS
BEGIN
IF (file_name = "" || file_name = "MENU") do_menu = TRUE
hold = PPEPATH() + LTRIM(STRING(PCBNODE())," ") + ".FLG"
IF (EXIST(hold)) DELETE hold
next_flag_file = 1
'
' Process the command line
' if first file processed and it exceeds a ratio,
' then do not even prompt for addition to the database.
'
' ****
' Might want to add a configuration file or something
' that allows this by security level & number of bytes
' ****
'
GOSUB PROCESS_COMMAND_LINE
'
' Set external text filename to a variable
'
tkltext = PPEPATH() + "TKLTEXT" + LANGEXT()
' Open the database file and the index.
'
GOSUB OPEN_DATABASE
IF (DERR(0)) THEN
NEWLINE
PRINTLN READLINE (tkltext,2)
NEWLINE
PRINTLN READLINE (tkltext,3)
NEWLINE
LOG "Cannot open TICKLE.DBF (DataBase) - Aborting", FALSE
WAIT
GOTO EXIT_PROG
END IF
GOSUB OPEN_INDEX
IF (DERR(0)) THEN
NEWLINE
PRINTLN READLINE (tkltext,4)
NEWLINE
PRINTLN READLINE (tkltext,3)
NEWLINE
LOG "Cannot open TICKLE.NDX (Index) - Aborting", FALSE
WAIT
GOTO EXIT_PROG
END IF
GOSUB FIND_ADD_USER
GOSUB READ_CFG
IF (pcbtext_number = "") LOG "'Tickle File' entered by user", FALSE
IF (file_name = "MENU" || pcbtext_number != "") GOSUB MENU
'
' Exit the program
'
GOTO EXIT_PROG
END
'
'====================================
'| |
'| Subroutines used in SAVFIL.PPE |
'| |
'====================================
'
'
'
:CHECK_NUMBER_RANGE
user_input = REPLACESTR(user_input, ",", " ")
IF (INSTR(user_input,"-") = 0 || INSTR(user_input,"-") = 1) RETURN
stack_var = user_input
user_input = ""
TOKENIZE stack_var
IF (TOKCOUNT() = 0) RETURN
FOR hold_num = 1 TO LEN(stack_var)
temp_var = GETTOKEN()
IF (temp_var = "") BREAK
IF (INSTR(temp_var, "-") = 0) THEN
user_input = user_input + temp_var + " "
ELSE
hold = MID(temp_var, 1, INSTR(temp_var,"-")-1)
IF (hold != "") hold2 = MID(temp_var, INSTR(temp_var,"-")+1, LEN(temp_var))
start = S2I(hold,10)
end = S2I(hold2,10)
IF (start < 1) THEN
IF (start = 0) hold = temp_var
NEWLINE
PRINTLN READLINE (tkltext,26), hold, READLINE (tkltext,27)
NEWLINE
CONTINUE
END IF
IF (end > 24) THEN
NEWLINE
PRINTLN READLINE (tkltext,26), end, READLINE (tkltext,27)
NEWLINE
CONTINUE
END IF
IF (end >= start) THEN
FOR count = start TO end
user_input = user_input + LTRIM(I2S(count,10)," ") + " "
NEXT
ELSE
NEWLINE
PRINTLN READLINE (tkltext,5), temp_var, READLINE (tkltext,6)
END IF
END IF
NEXT
RETURN
'
'
'
:STUFF_FLAG_FILES
flag_list = PPEPATH() + LTRIM(STRING(PCBNODE())," ") + ".FLG"
IF (EXIST(flag_list)) THEN
FOPEN 1, flag_list, O_WR, S_DN
ELSE
FCREATE 1, flag_list, O_WR, S_DN
END IF
start_flag = TRUE
hold = CHR(13) + "FLAG "
FOR i = 1 TO next_flag_file-1
hold = hold + flag_files(i) + " "
start_flag = FALSE
IF (LEN(hold) > 230) THEN
FPUTLN 1, hold
hold = CHR(13) + "FLAG "
END IF
NEXT
FPUTLN 1, hold
FCLOSE 1
RETURN
'
'
'
:FIND_EMPTY_SLOT
filenames_used = 0
FOR i = 2 TO 25
IF (DGET(0,DNAME(0,i)) = " ") THEN
filenames_used = i-1
BREAK
END IF
NEXT
RETURN
'
'
'
:CHECK_FOR_DUPES
file_dupe = FALSE
FOR i = 2 TO 25
IF ( UPPER(TRIM(DGET(0,DNAME(0,i))," ")) = UPPER(TRIM(file_name," ")) ) THEN
file_dupe = TRUE
BREAK
END IF
NEXT
RETURN
'
' Subroutine to find/add username in index
'
:FIND_ADD_USER
'
' Get the current users name
'
pcb_user_name = UPPER(RTRIM(U_NAME(), " "))
DSEEK 0, pcb_user_name
IF (DCHKSTAT(0) = 0) THEN
GOSUB FIND_EMPTY_SLOT
ELSE
'
' user not found - add a new record to the database
'
SPRINTLN READLINE (tkltext,7)
i = DRECCOUNT(0) + 1
DNEW 0
DLOCKR 0, i
DBLANK 0
DPUT 0, "usr_name", pcb_user_name
DADD 0
filenames_used = 1
END IF
RETURN
'
' Subroutine to display PCBText Message
'
:DISPLAY_FAILURE
NEWLINE
IF (!INSTR(file_name, "SHORLI")) THEN
SELECT CASE (pcbtext_number)
CASE "138"
DISPFILE PPEPATH() + "pcbt138", GRAPH+LANG
LOG "Insufficient time remaining to download (@OPTEXT@)", FALSE
CASE "159"
DISPFILE PPEPATH() + "pcbt159", GRAPH+LANG
LOG "(@OPTEXT@) Download bytes left available are @BYTESLEFT@", FALSE
'(@OPTEXT@) Sorry, @FIRST@, download bytes left available are @BYTESLEFT@
CASE "555"
DISPFILE PPEPATH() + "pcbt555", GRAPH+LANG
LOG "Batch limit reached. @OPTEXT@ was not added to the batch.", FALSE
CASE "669"
DISPFILE PPEPATH() + "pcbt669", GRAPH+LANG
LOG "Downloading @OPTEXT@ would exceed your file ratio.", FALSE
CASE "670"
DISPFILE PPEPATH() + "pcbt670", GRAPH+LANG
LOG "Downloading @OPTEXT@ would exceed your byte ratio.", FALSE
CASE "674"
DISPFILE PPEPATH() + "pcbt674", GRAPH+LANG
LOG "Downloading @OPTEXT@ would exceed your file limit.", FALSE
CASE "675"
DISPFILE PPEPATH() + "pcbt675", GRAPH+LANG
LOG "Downloading @OPTEXT@ would exceed your byte limit.", FALSE
END SELECT
ELSE
SELECT CASE (pcbtext_number)
CASE "138"
PRINTLN " @X0F*@X0D──────────────────────────────────────────────────────────@X0F*"
PRINTLN " @X0EInsufficient time remaining to download @X0A(@X0F@OPTEXT@@X0A)"
PRINTLN " @X0F*@X0D──────────────────────────────────────────────────────────@X0F*"
NEWLINES 2
WAIT
CASE "159"
PRINTLN " @X0F*@X0D──────────────────────────────────────────────────────────@X0F*"
PRIN